package cn.myjerry.thread.info;

/**
 * Thread.currentThread()	// 当前线程
 * setName()		// 设置名称
 * getName()		// 获取名称
 * isAlive()		// 获取状态
 * @author Jerry
 *
 */

public class InfoDemo01 {
	public static void main(String[] args) throws InterruptedException {
		MyThread it = new MyThread();
		Thread proxy = new Thread(it, "It");
		proxy.setName("test01");
		
		System.out.println(proxy.getName());
		System.out.println(Thread.currentThread().getName());
		
		proxy.start();
		
		System.out.println("start: --> " + proxy.isAlive());
		
		Thread.sleep(10);
		it.stop();
		
		Thread.sleep(10);
		System.out.println("stop: --> " + proxy.isAlive());
	}
}
